Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

idtoken-verifier

Package Overview
Dependencies
Maintainers
47
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

idtoken-verifier

A lightweight library to decode and verify RS JWT meant for the browser.

  • 2.2.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
182K
decreased by-0.41%
Maintainers
47
Weekly downloads
 
Created

What is idtoken-verifier?

The idtoken-verifier npm package is used to verify ID tokens, typically in the context of authentication and authorization. It helps ensure that the tokens are valid, properly signed, and not tampered with.

What are idtoken-verifier's main functionalities?

Verify ID Token

This feature allows you to verify the validity of an ID token. You need to provide the issuer and audience information, and then use the `verify` method to check the token. If the token is valid, the payload is returned; otherwise, an error is provided.

const IdTokenVerifier = require('idtoken-verifier');

const verifier = new IdTokenVerifier({
  issuer: 'https://your-issuer.com/',
  audience: 'your-audience'
});

const token = 'your-id-token';

verifier.verify(token, (err, payload) => {
  if (err) {
    console.error('Token verification failed:', err);
  } else {
    console.log('Token is valid. Payload:', payload);
  }
});

Decode ID Token

This feature allows you to decode an ID token without verifying it. The `decode` method returns the decoded token, which can be useful for inspecting the token's contents.

const IdTokenVerifier = require('idtoken-verifier');

const token = 'your-id-token';

const decoded = IdTokenVerifier.decode(token);
console.log('Decoded token:', decoded);

Other packages similar to idtoken-verifier

Keywords

FAQs

Package last updated on 27 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc